<%-- 
    Document   : KirimBarangPusat
    Created on : Nov 22, 2013, 12:03:35 PM
    Author     : tea milandi
--%>
<%@page import="bean.PemesananBarang"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="bean.StokBarang"%>
<%@page import="bean.PengirimanBarang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Kirim Barang Pusat</title>
    </head>
    <body bgcolor="FFC373"> 
        <%
            PengirimanBarang kirim = new PengirimanBarang();
            String kodePengiriman = kirim.getKodePengiriman();
        %>
        <form action="KirimBarang">
            <center>
                <br>
                <table border="0" width="490">
                    <tr>
                        <td colspan="6" align="center"><img src="gambar/logo asmart.png" width="300" height="84"/></td>
                    </tr>
                    <tr>
                        <td colspan="6" align="center"><font face="Disko" size="6px">DAFTAR PESANAN</font></td>
                    </tr>
                    <tr>
                        <td>
                            <table border="1" align="center">
                                <tr>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">KODE PEMESANAN</font></td>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">WAKTU PEMESANAN</font></td>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">JUMLAH BARANG</font></td>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">ID BARANG</font></td>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">USERNAME PEMESAN</font></td>
                                    <td align="center" bgcolor="663300"><font color="white" face="Francis Gothic Reduced">STATUS PENGIRIMAN</font></td>
                                </tr>
                                <%
                                    PemesananBarang pemesanan = new PemesananBarang();
                                    ResultSet re = pemesanan.tampilPemesanan();
                                    while (re.next()) {
                                        out.print("<tr><td align=\"center\" width=\"120\">" + re.getString("kodepemesanan") + "</td>"
                                                + "<td align=\"center\" width=\"100\">" + re.getString("waktupemesanan") + "</td>"
                                                + "<td align=\"center\" width=\"80\">" + re.getString("jumlahbarang") + "</td>"
                                                + "<td align=\"center\" width=\"80\">" + re.getString("idbarang") + "</td>"
                                                + "<td align=\"center\" width=\"100\">" + re.getString("username") + "</td>"
                                                + "<td align=\"center\" width=\"100\">" + re.getString("status_pengiriman") + "</td></tr>");
                                    }
                                %>
                            </table>
                        </td>

                    </tr>


                </table>

                <center><font face="Disko" size="6px">FORM PENGIRIMAN BARANG</font></center>
                <table border="0" align="center" width="250" height="100">
                    <tr>
                        <td><font face="Francis Gothic Reduced">KODE PENGIRIMAN</font></td>
                        <td><input type="text" size="10" maxlength="8" name="kode_pengiriman" value="<%=kodePengiriman%>" disabled="disabled"></td>
                    </tr>
                    <tr>
                        <td><font face="Francis Gothic Reduced">KODE PEMESANAN</font></td>
                        <td><select name="kodepemesanan"><%
                            PemesananBarang pemesanan1 = new PemesananBarang();
                            ResultSet resultSet = pemesanan1.tampilPemesanan();
                            while (resultSet.next()) {
                                out.print("<option value='" + resultSet.getString("kodepemesanan") + "'>" + resultSet.getString("kodepemesanan") + "</option>");
                            }
                                %>
                            </select></td>
                    </tr>
                    <tr>
                        <td><font face="Francis Gothic Reduced">JUMLAH BARANG</font></td>
                        <td><input type="text" size="10" maxlength="6" name="jumlahbarang"></td>
                    </tr>
                    <tr>
                        <td><font face="Francis Gothic Reduced">HARGA BARANG</font></td>
                        <td><input type="text" size="10" maxlength="6" name="hargabarang"></td>
                    </tr>
                </table>
                <table border="0" align="center" width="280"> 
                    <tr>
                        <td align="center" width="46%"><a href="HomePusat.jsp"><img src="gambar/back_button.png" height="40" width="120"></a></td>
                        <td align="center"><input type="image" src="gambar/simpan_button.png" height="40" width="120" name="simpan"></td>
                    </tr>
                </table>
            </center>
        </form>
    </body>
</html>
